//
//  Common.swift
//  ZJCSina
//
//  Created by 朱建超 on 16/11/16.
//  Copyright © 2016年 itHeiMa. All rights reserved.
//

import UIKit

let client_id = "2549645888"

let client_secret = "a3f810bc8443ff9d9abbe19c521ce77a"

let redirect_uri = "http://www.itheima.com"

//定义切换根视图的通知名称
let chooseRootViewController = "chooseRootViewController"

func randomColor() -> UIColor {
    
    let r = CGFloat(arc4random() % 256) / 255.0
    let g = CGFloat(arc4random() % 256) / 255.0
    let b = CGFloat(arc4random() % 256) / 255.0
    
    return UIColor(red: r, green: g, blue: b, alpha: 1)
    
}

//定义全局的日期格式化对象
let dateFormatter = DateFormatter()

//定义全局的正则表达式
let contactSomeOneRegex = try! NSRegularExpression(pattern: "@\\w+", options: [])
let huaTiRegex = try! NSRegularExpression(pattern: "#.*?#", options: [])
let httpRegex = try! NSRegularExpression(pattern: "(http|ftp|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&amp;:/~\\+#]*[\\w\\-\\@?^=%&amp;/~\\+#])?", options: [])
let emotionRegex = try! NSRegularExpression(pattern: "\\[.*?\\]", options: [])
